﻿<%--
   Copyright 2012 University of Southampton

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
--%>

<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ExperimentDetails.aspx.cs" Inherits="uk.ac.soton.ses.layouts.ExperimentDetails" DynamicMasterPageFile="~masterurl/default.master" %>

<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI.WebControls" TagPrefix="asp" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<%@ Register TagPrefix="hdc" TagName="ExperimentQuickSearch" Src="/_ControlTemplates/uk.ac.soton.ses/HDCUserControls/ExperimentQuickSearch.ascx" %>
<%@ Register TagPrefix="hdc" TagName="ExperimentUsers" Src="/_ControlTemplates/uk.ac.soton.ses/HDCUserControls/ExperimentUsers.ascx" %>
<%@ Register TagPrefix="hdc" TagName="ExperimentDataItems" Src="/_ControlTemplates/uk.ac.soton.ses/HDCUserControls/ExperimentDataItems.ascx" %>
<%@ Register TagPrefix="hdc" TagName="ExperimentMetadataTools" Src="/_ControlTemplates/uk.ac.soton.ses/HDCUserControls/ExperimentMetadataToolsUserControl.ascx" %>
<%@ Register TagPrefix="hdc" TagName="ExperimentLinks" Src="/_ControlTemplates/uk.ac.soton.ses/HDCUserControls/ExperimentLinksWebPartUserControl.ascx" %>
<%@ Register TagPrefix="hdc" TagName="ExperimentCollections" Src="/_ControlTemplates/uk.ac.soton.ses/HDCUserControls/ExperimentCollectionsWebPartUserControl.ascx" %>
<%@ Register TagPrefix="hdc" TagName="ExperimentActions" Src="/_ControlTemplates/uk.ac.soton.ses/HDCUserControls/ExperimentActionsWebPartUserControl.ascx" %>
<%@ Register TagPrefix="hdc" TagName="CreateExperiment" Src="/_ControlTemplates/uk.ac.soton.ses/HDCUserControls/CreateExperimentUserControl.ascx" %>

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
    <script type="text/javascript">
    </script>
</asp:Content>

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">

    <ul class="hdctoolbullets">
        <%--Tool to search for other experiments: --%>
        <li class="hdctool"><hdc:ExperimentQuickSearch ID="Control_ExperimentQuickSearch" runat="server" SearchLabelText="Quick search (experiment, file or parameter):"/></li>

        <%-- Tool to create a new experiment: --%>
        <li class="hdctool"><hdc:CreateExperiment ID="Control_CreateExperiment" runat="server" /></li>
    </ul>

    <asp:Literal ID="literal_ExperimentTitle" runat="server" />
    <asp:PlaceHolder ID="placeholder_ErrorReporting" runat="server" />

    <asp:Panel ID="panel_Experiment" runat="server">

        <div id="details">

            <%--Summary section --%>
            <div class="LeftWideColumn">
                <h4>Experiment summary</h4>
                <div>
                    <%-- This summary contains a left summary DIV and a right DIV containing a thumbnail--%>
                    <div style="float:left;">
                        <asp:FormView ID="View_ExperimentDetails" runat="server" DataKeyNames="ID">
                            <ItemTemplate>
                                <p>Experiment <b><asp:Label ID="Label_Name" runat="server" /> (<asp:Label ID="Label_ID" runat="server" />)</b>
                                of type <b><asp:LinkButton ID="Button_Type" runat="server" CommandName="Edit" /></b></p>
                                <p><asp:Label ID="Label_DescriptionTitle" runat="server" /><asp:LinkButton ID="Button_Description" runat="server" Font-Bold="true" CommandName="Edit" /></p>
                                <p>Last modified <b><asp:Label ID="Label_Date" runat="server" /></b></p>
                                <p><span style="color:Green"><asp:Label ID ="Label_LocationTitle" runat="server" /><asp:Label ID="Label_Location" runat="server" /></span></p>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <table>
                                <tr><td><b>Type:</b></td><td><asp:DropDownList ID="List_ExperimentTypes" runat="server" DataTextField="Name" DataValueField="ID" /></td></tr>
                                <tr><td><b>Description:</b></td><td><asp:TextBox ID="TextBox_Description" runat="server" Width="200px" /></td></tr>
                                </table>

                                <b><asp:LinkButton ID="button_EditExperimentDetails" runat="server" Text="Save" CommandName="Save" CssClass="ActionLink" />,
                                <asp:LinkButton ID="button_CancelEditing" runat="server" Text="Cancel" CommandName="Cancel" CssClass="ActionLink"/></b>
                            </EditItemTemplate>
                        </asp:FormView>
                        <p>Experiment plugins: <hdc:ExperimentActions ID="Control_ExperimentActions" runat="server" /></p>
                    </div>
                    <%-- Thumbnail DIV --%>
                    <div style="float:left;margin-left:2em">
                        <asp:Image ID="Image_ExperimentThumbnail" runat="server" Height="9em" />
                    </div>
                    <div class="ClearFloats"></div>
                </div>
                <h4>Contents</h4>
                <p><a href="#datafilestitle">Data files</a></p>
                <p><a href="#parameterstitle">Metadata</a></p>
                <p><a href="#linkingtitle">Linking</a></p>
            </div>

            <%--Security/Actions section--%>
            <div class="RightNarrowColumn">
                <h4 id="securitytitle">Security</h4>
                <hdc:ExperimentUsers ID="Control_ExperimentUsers" runat="server" />
            </div>

            <div class="ClearFloats"></div>
        </div>

        <h3 id="datafilestitle" class="hideable HDCH3">Data Files</h3>
        <div id="datafiles">
            <hdc:ExperimentDataItems ID="Control_ExperimentDataItems" runat="server" />
        </div>

        <h3 id="parameterstitle" class="hideable HDCH3">Metadata/Parameters</h3>
        <div id="parameters">
            <h4>Defined parameters</h4>
            <p>Use this section to define metadata or parameters for your experiment. These parameters can be nested by dragging a parameter on top of another. Parameters can sometimes be imported from a file by using one of the plugins in the data files section. <b>Please note, clicking Add, Edit or Delete while editing parameters will save any changes you have made. If you need to abort your changes, ensure you click Cancel before you click Add, Edit or Delete.</b></p>
            <asp:PlaceHolder ID="ParameterEntryPlaceHolder" runat="server"></asp:PlaceHolder>

            <h4>Metadata tools</h4>
            <p>Use this section to copy parameters between experiments.</p>
            <hdc:ExperimentMetadataTools ID="Control_ExperimentMetadataTools" runat="server" />
        </div>

        <h3 id="linkingtitle" class="hideable HDCH3">Linking</h3>
        <div id="linking">
            <div class="LeftWideColumn">
                <h4>Linked experiments</h4>
                <hdc:ExperimentLinks ID="Control_ExperimentLinks" runat="server" />
                <hr />
                <h4>Container collections</h4>
                <hdc:ExperimentCollections ID="Control_ExperimentCollections" runat="server" />
            </div>
            <div class="RightNarrowColumn">
                <h4>Related experiments</h4>
                <h5>Suggested experiments based on existing links:</h5>
                <asp:Repeater ID="list_RelatedExperiments_Linked" runat="server">
                    <HeaderTemplate><ul class="hdcrelatedexperimentlist"></HeaderTemplate>
                    <ItemTemplate>
                        <li><asp:HyperLink ID="btn_RelatedExperiment" runat="server" Text='<%#Eval("Name") %>' Target="_blank" NavigateUrl='<%#"/_layouts/HDC/ExperimentDetails.aspx?ID=" + Eval("ID") %>' ToolTip='<%# Eval("Description") %>' /></li>
                    </ItemTemplate>
                    <FooterTemplate></ul></FooterTemplate>
                </asp:Repeater>

                <h5>Experiments of the same type:</h5>
                <asp:Repeater ID="list_RelatedExperiments_SameType" runat="server">
                    <HeaderTemplate><ul class="hdcrelatedexperimentlist"></HeaderTemplate>
                    <ItemTemplate>
                        <li><asp:HyperLink ID="btn_RelatedExperiment" runat="server" Text='<%#Eval("Name") %>' Target="_blank" NavigateUrl='<%#"/_layouts/HDC/ExperimentDetails.aspx?ID=" + Eval("ID") %>' ToolTip='<%# Eval("Description") %>' /></li>
                    </ItemTemplate>
                    <FooterTemplate></ul></FooterTemplate>
                </asp:Repeater>
            </div>    
            <div class="ClearFloats"></div>
        </div>

    </asp:Panel>

    <asp:PlaceHolder ID="DebuggingInfoPlaceHolder" runat="server" />

</asp:Content>

<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
<asp:Literal id="literal_PageTitle" Text="Application Page" runat="server" />
</asp:Content>

<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
<asp:Literal id="literal_PageHeading" Text="Application Page" runat="server" />
</asp:Content>
